import * as Blockly from 'blockly/core';

const TOOLS_HUE = "#555555";

export const rpipico_pin = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(require("../media/board_pin/Raspberry Pi Pico.jpg"), 525, 372, "*"));
        this.setColour(TOOLS_HUE);
        this.setTooltip();
        this.setHelpUrl();
    }
};

export const rpipicow_pin = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(require("../media/board_pin/Raspberry Pi Pico W.jpg"), 525, 372, "*"));
        this.setColour(TOOLS_HUE);
        this.setTooltip();
        this.setHelpUrl();
    }
};

export const xnr_codetype = {
    init: function () {
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_CENTRE)
            .appendField("汉字编码查询");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_CENTRE)
            .appendField("输入文字:")
            .appendField(new Blockly.FieldMultilineInput("新农人"), "h_e156");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_CENTRE)
            .appendField("编码方式:")
            .appendField(new Blockly.FieldDropdown([["GB2312", "GB2312"], ["Unicode", "Unicode"]]), "h_e157");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_CENTRE)
            .appendField("输出数据:")
            .appendField(new Blockly.FieldMultilineInput(""), "h_e158");
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(TOOLS_HUE);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

export const xnr_codetype_1 = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldDropdown([["GB2312编码", "GB2312"], ["Unicode编码", "Unicode"]]), "h_e152");
        this.appendDummyInput()
            .appendField("  数据")
            .appendField(new Blockly.FieldTextInput("窗前明月光，疑似地上霜;举头望明月，低头思故乡!"), "h_e153");
        this.setInputsInline(true);
        this.setOutput(true, null);
        this.setColour(TOOLS_HUE);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};